package com.kjtpay.design_pattern.observer;

class NBAObserver extends Observer {
    public NBAObserver(String name) {
        super(name);
        action = "没有发现人来，" + name + "在看NBA直播";
    }

    @Override
    public void update(String subjectState) {
        if (subjectState == "老板") {
            action = "老板来了，" + name + "关闭NBA直播，继续工作！";
        } else if (subjectState == "秘书") {
            action = "秘书来了，" + name + "可以继续看NBA直播";
        } else {
            // 不知道谁来了，不操作
        }
    }
}
